Skip to content

feat(approvals): declare decision actions on sys_approval_request (objectui#2678 P2-4)#3282

Merged
os-zhuang merged 1 commit into
mainfrom
claude/enterprise-delegation-ooo-proxy-1v3m8l
Jul 19, 2026
Merged

feat(approvals): declare decision actions on sys_approval_request (objectui#2678 P2-4)#3282
os-zhuang merged 1 commit into
mainfrom
claude/enterprise-delegation-ooo-proxy-1v3m8l

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Framework half of objectui#2678 P2-4 (inbox action SDUI-ification). The UI counterpart (a generic DeclaredActionsBar consuming these) rides a parallel objectui PR.

What

sys_approval_request now declares its decision actions as metadata — approval_approve, approval_reject, approval_reassign — each a type:'api' action targeting the existing approvals REST route:

  • {id} in the target resolves from the row; actorId defaults to the caller server-side (existing route behavior).
  • Typed params render the console's generic param dialog: optional comment (textarea) on all three; required to on reassign.
  • visible: 'record.status == "pending"' trims finished requests — display-only; the service's pending-approver check stays authoritative.
  • Reject carries a confirmText; all three refreshAfter.
  • Locations: record_section (+ list_item for approve/reject quick actions).

Why

This is the structural fix for the "hand-edit the inbox per feature" anti-pattern (#2678 调研判定): with the actions declared on the object, the console's generic action runtime renders and executes them wherever the object is surfaced — so future decision capabilities (enterprise act-as, cloud#861 included) ship as metadata, with zero bespoke frontend.

Tests

Full plugin-approvals suite green (137) with the declaration in place (object schema parses eagerly at import, so an invalid action shape would fail every test).

Refs

objectui#2678 (P2-4) · follows #3274 (merged)

🤖 Generated with Claude Code


Generated by Claude Code

…jectui#2678 P2-4)

Server-declared approve / reject / reassign actions on the request object, so
the console's generic action runtime renders and executes them wherever the
object is surfaced — the approvals inbox included. Each is a `type:'api'`
action targeting the existing REST route ({id} resolves from the row; actorId
defaults to the caller server-side), with typed params (comment; reassign's
`to`), a pending-only `visible` gate (display-only — the service's
pending-approver check stays authoritative), and a confirm on reject.

This is the framework half of the P2-4 SDUI migration: future decision
capabilities (enterprise act-as included) ship as metadata on this object,
not as hand-written inbox buttons. 137 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ypkQikZ55oWUHUnMebwXA
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 19, 2026 1:34pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-approvals.

4 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/automation/approvals.mdx (via @objectstack/plugin-approvals)
  • content/docs/plugins/packages.mdx (via @objectstack/plugin-approvals)
  • content/docs/releases/implementation-status.mdx (via @objectstack/plugin-approvals)
  • content/docs/releases/v9.mdx (via @objectstack/plugin-approvals)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang marked this pull request as ready for review July 19, 2026 13:37
@os-zhuang
os-zhuang merged commit 45f266b into main Jul 19, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/enterprise-delegation-ooo-proxy-1v3m8l branch July 19, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants